﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

using mvcForum.Core;

namespace mvcForum.Web.ViewModels {

	public class ForumUserViewModel {

		public ForumUserViewModel() { }

		public ForumUserViewModel(ForumUser user) {
			this.Id = user.Id;
			this.Name = user.Name;
			this.Email = user.EmailAddress;
			//this.Active = user.Active;
			this.Deleted = user.Deleted;
			this.LastIP = user.LastIP;
			this.FirstVisit = user.FirstVisit;
			//this.FirstVisit = user.Created;
			this.LastVisit = user.LastVisit;
		}

		[Required]
		public Int32 Id { get; set; }
		//[Required]
		public String Name { get; set; }
		[Required]
		public String Email { get; set; }
		[Required]
		public Boolean Active { get; set; }
		[Required]
		public Boolean Deleted { get; set; }

		public String NewPassword { get; set; }
		public String RepeatNewPassword { get; set; }

		public DateTime FirstVisit { get; set; }
		public DateTime LastVisit { get; set; }
		public String LastIP { get; set; }

		public IEnumerable<GroupViewModel> Groups { get; set; }
		public IEnumerable<GroupViewModel> MemberOf { get; set; }
	}
}